const tmpl = `
using Yell.Domain.{{module}};

namespace Yell.Application.{{module}}.{{Domian}}s;

[ApiDescriptionSettings(ApiGroups.MES, Module = ApiGroups.MES)]
public class {{Domian}}AppService : AppService
{
    private readonly I{{Domian}}Service _{{domian}}Service;

    public {{Domian}}AppService(I{{Domian}}Service {{domian}}Service)
    {
        _{{domian}}Service = {{domian}}Service;
    }

    public Task<PageList<{{Domian}}>> GetListAsync([FromQuery] {{Domian}}SearchInput input)
    {
        return _{{domian}}Service.GetListAsync(input);
    }


    public Task<{{Domian}}> GetAsync(long id)
    {
        return _{{domian}}Service.GetAsync(id);
    }

    public Task CreateAsync({{Domian}} {{domian}})
    {
        return _{{domian}}Service.CreateAsync({{domian}});
    }


    public Task UpdateAsync({{Domian}} {{domian}})
    {
        return _{{domian}}Service.UpdateAsync({{domian}});
    }


    public Task DeleteAsync(string ids)
    {
        return _{{domian}}Service.DeleteAsync(Utils.Split<long>(ids).ToArray());
    }

}

`

export function genAppServiceCode(domain: string, moduleName: string) {
  return tmpl.replaceAll('{{domian}}', domain)
    .replaceAll('{{Domian}}', domain.slice(0, 1).toUpperCase() + domain.slice(1))
    .replaceAll('{{module}}', moduleName)
}